<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>box-sizing属性使用</title>
		<style type="text/css">
			* {
				margin: 0;
				padding: 0;
			}

			#content {
				width: 500px;
				margin: 50px auto;
			}

			header,
			nav,
			article,
			footer {
				text-align: center;
				border: solid 5px #666;
			}

			header {
				height: 40px;
				line-height: 40px;
			}

			nav {
				margin: 40px 50px 40px 0;
				box-sizing: border-box;
				/*当定义width和height时，border和padding的参数值被包含在width和height之内*/
				float: left;
				width: 30%;
				height: 150px;
				line-height: 150px;
				/*垂直方向文本居中*/
			}

			article {
				box-sizing: border-box;
				/*当定义width和height时，border和padding的参数值被包含在width和height之内*/
				margin: 40px 0px 40px 0;
				float: left;
				width: 60%;
				height: 150px;
				line-height: 150px;
			}

			footer {
				clear: left;
				/*清除左浮动*/
				height: 40px;
				line-height: 40px;
			}
		</style>
	</head>
	<body>
		<!--结构代码-->
		<div id="content">
			<header>导航</header>
			<nav>菜单</nav>
			<article>内容</article>
			<footer>底部说明</footer>
		</div>
	</body>
</html>
